package com.dubbo.provider.Service.Impl;

import com.dubbo.api.ProductServiceApi;
import com.dubbo.mapper.ProductMapper;
import com.dubbo.pojo.Product;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

@Service
public class ProductServiceImpl implements ProductServiceApi {

    @Autowired
    private ProductMapper productMapper;

    @Override
    public int addProduct(Product product) {
        return productMapper.addProduct(product);
    }

    @Override
    public List<Product> showList() {
        return productMapper.showList();
    }

    @Override
    public Product showOne(int id) {
        Product product = productMapper.showOne(id);
        return product;
    }
}
